package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbNewsCommentsMapper;
import com.ruoyi.system.domain.TbNewsComments;
import com.ruoyi.system.service.ITbNewsCommentsService;

/**
 * 新闻评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-11
 */
@Service
public class TbNewsCommentsServiceImpl implements ITbNewsCommentsService 
{
    @Autowired
    private TbNewsCommentsMapper tbNewsCommentsMapper;

    /**
     * 查询新闻评论
     * 
     * @param id 新闻评论主键
     * @return 新闻评论
     */
    @Override
    public TbNewsComments selectTbNewsCommentsById(Long id)
    {
        return tbNewsCommentsMapper.selectTbNewsCommentsById(id);
    }

    /**
     * 查询新闻评论列表
     * 
     * @param tbNewsComments 新闻评论
     * @return 新闻评论
     */
    @Override
    public List<TbNewsComments> selectTbNewsCommentsList(TbNewsComments tbNewsComments)
    {
        return tbNewsCommentsMapper.selectTbNewsCommentsList(tbNewsComments);
    }

    /**
     * 新增新闻评论
     * 
     * @param tbNewsComments 新闻评论
     * @return 结果
     */
    @Override
    public int insertTbNewsComments(TbNewsComments tbNewsComments)
    {
        tbNewsComments.setCreateTime(DateUtils.getNowDate());
        return tbNewsCommentsMapper.insertTbNewsComments(tbNewsComments);
    }

    /**
     * 修改新闻评论
     * 
     * @param tbNewsComments 新闻评论
     * @return 结果
     */
    @Override
    public int updateTbNewsComments(TbNewsComments tbNewsComments)
    {
        tbNewsComments.setUpdateTime(DateUtils.getNowDate());
        return tbNewsCommentsMapper.updateTbNewsComments(tbNewsComments);
    }

    /**
     * 批量删除新闻评论
     * 
     * @param ids 需要删除的新闻评论主键
     * @return 结果
     */
    @Override
    public int deleteTbNewsCommentsByIds(Long[] ids)
    {
        return tbNewsCommentsMapper.deleteTbNewsCommentsByIds(ids);
    }

    /**
     * 删除新闻评论信息
     * 
     * @param id 新闻评论主键
     * @return 结果
     */
    @Override
    public int deleteTbNewsCommentsById(Long id)
    {
        return tbNewsCommentsMapper.deleteTbNewsCommentsById(id);
    }
}
